import Vue from "vue";
import VueRouter from "vue-router";

// 引入组件
import recommend from "@/view/recommend";
import singer from "@/view/singer";
import rank from "@/view/rank";
import songList from '@/view/songList.vue'
import search from '@/view/search.vue'
import albumList from '@/view/albumList.vue'

// 要告诉 vue 使用 vueRouter
Vue.use(VueRouter);

const routes = [
    {
        path:"/",
        redirect: '/recommend'
    },
    {
        path:"/recommend",
        component: recommend
    },
    {
        path:"/singer",
        component: singer
    },
    {
        path:"/rank",
        component: rank
    },
    {
        path:"/songList/:id",
        component: songList
    },
    {
        path:"/search",
        component: search
    }, 
    {
        path:"/albumList/:id",
        component: albumList
    }, 
]

var router =  new VueRouter({
    routes
});

export default router;